/*
    除了首页之外的全部动态菜单
*/

const Product = () => import('@/views/product/index')
const List = () => import('@/views/product/list/index')
const Category = () => import('@/views/product/category/index')
const AddProduct = () => import('@/views/product/list/AddProduct.vue')

const Order = () => import('@/views/order/index')
const OrderList = () => import('@/views/order/list/index')
const Collect = () => import('@/views/order/collect/index')
const Contract=()=>import('@/views/order/contract/index')

const Advert = () => import('@/views/advert/index')
const AdvertList = () => import('@/views/advert/list/index')

//系统管理
import SystemManage from '@/views/SystemManage'
import department from '@/views/SystemManage/department'
import role from '@/views/SystemManage/role'
export const menu = [
    {
        path: '/product',
        name: 'product',
        component: Product,
        meta: {
            title: '产品管理'
        },
        redirect: '/product/list',
        children: [
            {
                path: 'list',// 路径/product/list
                name: 'plist',
                component: List,
                meta: {
                    title: '产品列表'
                },
            },
            {
                path: 'category',// 路径 /product/category
                name: 'category',
                component: Category,
                meta: {
                    title: '产品分类'
                },
            },
            {
                path: 'add-product',// 商品添加，编辑，查看
                name: 'AddProduct',
                component: AddProduct,
                meta: {//配置高亮标识
                    //activeMenu: '/product/list',//根据路径匹配高亮
                    activeMenu: 'plist',//根据名称name匹配高亮
                    title: '商品添加'
                }
            },
        ]
    },

    {
        path: '/order',
        name: 'order',
        component: Order,
        meta: {
            title: '订单管理'
        },
        redirect: '/order/list',
        children: [
            {
                path: 'list',// 路径/order/list
                name: 'olist',
                component: OrderList,
                meta: {
                    title: '订单列表'
                },
            },
            {
                path: 'collect',// 路径 /order/collect
                name: 'collect',
                component: Collect,
                meta: {
                    title: '汇总清单'
                },
            },
            {
                path: 'contract',// 路径 /order/contract
                name: 'contract',
                component: Contract,
                meta: {
                    title: '订单打印'
                },
            }
        ]
    },

    {
        path: '/advert',
        name: 'advert',
        component: Advert,
        meta: {
            title: '广告分类'
        },

        children: [
            {
                path: 'list',// 路径/advert/list
                name: 'alist',
                component: AdvertList,
                meta: {
                    title: '广告列表'
                },
            }
        ]
    },
    {
        path: "/system",
        name: "system",
        component: SystemManage,
        redirect: "/system/role",
        meta: {
            title: "系统管理",
        },
        children: [
            {
                path: "role",
                name: "role",
                component: role,
                meta: {
                    title: "角色管理",
                },
            },
            {
                path: "department",
                name: "department",
                component: department,
                meta: {
                    title: "部门管理",
                },
            },
        ],
    },

]
